//
//  SEGUhomeMediator+Payment.m
//  Commom
//
//  Created by 山刘 on 2018/12/28.
//  Copyright © 2018年 山刘. All rights reserved.
//

#import "SEGUhomeMediator+Payment.h"

NSString * const kTargetPay = @"Pay";
NSString * const kActionPayInitDidPaidViewController = @"initDidPaidViewController";
NSString * const kActionPayGetDidPayViewControllerClass = @"getDidPayViewControllerClass";
NSString * const kActionPayInitPayListViewController = @"initPayListViewController";
NSString * const kActionMiniProgram               = @"initMiniProgram";
NSString * const kActionSendPay               = @"initPayAction";
NSString * const kActionInitICBCPayBackWithParams    = @"initICBCPayBackWithParams";
NSString * const kActionInitUMSPPPayWithParams    = @"initUMSPPPayWithParams";
NSString * const kActionUMSPPPaycloudPayHandleOpenURLWithParams    = @"UMSPPPaycloudPayHandleOpenURLWithParams";
NSString * const kActionUMSPPayHandleOpenURLWithParams = @"UMSPPayHandleOpenURLWithParams";


@implementation SEGUhomeMediator (Payment)
-(UIViewController *)seg_initSEGPaymentViewController:(NSDictionary*)params{
    return [self performTarget:@"Payment" action:@"initSEGPaymentViewController" params:params shouldCacheTarget:NO];
}

-(UIViewController *)seg_initSEGPaymentViewController:(NSDictionary*)paymethods completed:(NSDictionary* (^)(NSDictionary* method))completed{
    NSMutableDictionary *tmp = [NSMutableDictionary dictionary];
    if (paymethods) [tmp setValue:paymethods forKey:@"mentodInfos"];
    if (completed) [tmp setValue:completed forKey:@"payCompleted"];
    return [self performTarget:@"Payment" action:@"initSEGPaymentViewController" params:tmp shouldCacheTarget:NO];
}


-(UIViewController *)seg_initDidPaidViewController:(NSDictionary *)params {
    return [self performTarget:kTargetPay action:kActionPayInitDidPaidViewController params:params shouldCacheTarget:NO];
}

/// 发起侨城汇支付
-(void)seg_sendPayForQiaoChengHuiWithParams:(NSDictionary *)params {
    [self performTarget:kTargetPay action:@"sendPayForQiaoChengHuiWithParams" params:params shouldCacheTarget:NO];
}

/// 发起聚合支付
-(void)seg_sendPayForPayOnLineWithParams:(NSDictionary *)params {
    [self performTarget:kTargetPay action:@"sendPayForPayOnLineWithParams" params:params shouldCacheTarget:NO];
}

-(Class)seg_getDidPayViewControllerClass:(NSDictionary *)params {
    return [self performTarget:kTargetPay action:kActionPayGetDidPayViewControllerClass params:params shouldCacheTarget:NO];
}

-(UIViewController *)seg_initPayListViewController:(NSDictionary *)params {
    return [self performTarget:kTargetPay action:kActionPayInitPayListViewController params:params shouldCacheTarget:NO];
}

- (void)seg_initMiniProgram:(NSDictionary *)params {
    [self performTarget:kTargetPay action:kActionMiniProgram params:params shouldCacheTarget:NO];
}

- (void)seg_initPayAction:(NSDictionary *)params {
    [self performTarget:kTargetPay action:kActionSendPay params:params shouldCacheTarget:NO];
}

- (void)seg_initICBCPayBackWithParams:(NSDictionary *)params {
    [self performTarget:kTargetPay action:kActionInitICBCPayBackWithParams params:params shouldCacheTarget:NO];
}

- (BOOL)seg_initUMSPPPayWithParams:(NSDictionary *)params {
    return [[self performTarget:kTargetPay action:kActionInitUMSPPPayWithParams params:params shouldCacheTarget:NO] boolValue];
}

- (BOOL)seg_UMSPPPaycloudPayHandleOpenURLWithParams:(NSDictionary *)params {
    return [[self performTarget:kTargetPay action:kActionUMSPPPaycloudPayHandleOpenURLWithParams params:params shouldCacheTarget:NO] boolValue];
}

- (BOOL)seg_UMSPPayHandleOpenURLWithParams:(NSDictionary *)params {
    return [[self performTarget:kTargetPay action:kActionUMSPPPaycloudPayHandleOpenURLWithParams params:params shouldCacheTarget:NO] boolValue];
}

@end
